*Heuristics and Accountability do file

*Experimental factors (for regression analysis)
gen SBAid = .
recode SBAid (.=1) if SBA_DO_Q2_1==1
recode SBAid (.=0) if SBA_DO_Q2_2==1
recode SBAid (.=1) if SBA_DO_Q2_3==1
recode SBAid (.=0) if SBA_DO_Q2_4==1
gen SBAev = .
recode SBAev (.=1) if SBA_DO_Q2_1==1
recode SBAev (.=1) if SBA_DO_Q2_2==1
recode SBAev (.=0) if SBA_DO_Q2_3==1
recode SBAev (.=0) if SBA_DO_Q2_4==1

gen USDAid = .
recode USDAid (.=1) if USDA_DO_Q3_1==1
recode USDAid (.=0) if USDA_DO_Q3_2==1
recode USDAid (.=1) if USDA_DO_Q3_3==1
recode USDAid (.=0) if USDA_DO_Q3_4==1
gen USDAev = .
recode USDAev (.=1) if USDA_DO_Q3_1==1
recode USDAev (.=1) if USDA_DO_Q3_2==1
recode USDAev (.=0) if USDA_DO_Q3_3==1
recode USDAev (.=0) if USDA_DO_Q3_4==1

*Experimental arms (for balance tests)
gen SBAarms = .
recode SBAarms (.=1) if SBA_DO_Q2_1==1
recode SBAarms (.=2) if SBA_DO_Q2_2==1
recode SBAarms (.=3) if SBA_DO_Q2_3==1
recode SBAarms (.=4) if SBA_DO_Q2_4==1

gen USDAarms = .
recode USDAarms (.=1) if USDA_DO_Q3_1==1
recode USDAarms (.=2) if USDA_DO_Q3_2==1
recode USDAarms (.=3) if USDA_DO_Q3_3==1
recode USDAarms (.=4) if USDA_DO_Q3_4==1

*Political knowledge scale
gen polknow = 0
replace polknow = (polknow + 1) if Q19_1==2
replace polknow = (polknow + 1) if Q19_2==1
replace polknow = (polknow + 1) if Q19_3==3
replace polknow = (polknow + 1) if Q19_4==2
replace polknow = (polknow + 1) if Q19_5==3
*to account for missing values . . .
alpha Q19_1-Q19_5, item gen(Q19sum) 
recode polknow (0=.) if Q19sum==.

*Dichotomous partyID variable
gen partyID = Q20_7
recode partyID (3=1) if Q20_8==1
recode partyID (3=2) if Q20_8==2
recode partyID (3=.)

*Recodes for balance tests
gen Q20_3rec = Q20_3
recode Q20_3rec (1/4=1) (5/7=2)
gen Q20_4dollars = Q20_4
recode Q20_4dollars (1=5000)(2=15000)(3=25000)(4=35000)(5=45000)(6=55000) ///
(7=65000)(8=75000)(9=85000)(10=95000)(11=125000)(12=175000)(13=250000)(14=55000)
*Note for income: 1-12 midpoint approximation; 13 estimated midpoint; 14 median substitution

*Balance tests for SBA experiment
tab2 Q1_4 SBAarms, chi col
oneway Q1_5 SBAarms, tabulate
tab2 Q1_6 SBAarms, chi col
tab2 Q1_7 SBAarms, chi col
tab2 Q20_3rec SBAarms, chi col
oneway Q20_4dollars SBAarms, tabulate
tab2 Q20_5 SBAarms, chi col
oneway Q20_6_1 SBAarms, tabulate
tab2 Q20_7 SBAarms, chi col
oneway polknow SBAarms, tabulate

tab2 Q1_4 USDAarms, chi col
oneway Q1_5 USDAarms, tabulate
tab2 Q1_6 USDAarms, chi col
tab2 Q1_7 USDAarms, chi col
tab2 Q20_3rec USDAarms, chi col
oneway Q20_4dollars USDAarms, tabulate
tab2 Q20_5 USDAarms, chi col
oneway Q20_6_1 USDAarms, tabulate
tab2 Q20_7 USDAarms, chi col
oneway polknow USDAarms, tabulate

*Analysis of variance and plots (Figures 1-4)
 
anova  Q2_5_1 SBAid##SBAev
margins SBAid#SBAev
marginsplot

anova  Q2_6_6 SBAid##SBAev
margins SBAid#SBAev
marginsplot

anova  Q3_5_1 USDAid##USDAev
margins USDAid#USDAev
marginsplot

anova  Q3_6_1 USDAid##USDAev
margins USDAid#USDAev
marginsplot

*Regression analysis (Tables 1-2)
*(note: uses the 'listcoef' add-in program)

recode SBAid (0=-.5) (1=.5)
recode SBAev (0=-.5) (1=.5)
reg Q2_5_1 c.SBAid##c.SBAev
listcoef
reg Q2_6_6 c.SBAid##c.SBAev
listcoef

recode USDAid (0=-.5) (1=.5)
recode USDAev (0=-.5) (1=.5)
reg Q3_5_1 c.USDAid##c.USDAev
listcoef
reg Q3_6_1 c.USDAid##c.USDAev
listcoef

*Subgroup regressions
gen polknow2 = polknow
recode polknow2 (1/3=0)(4/5=1)
gen leftright = Q20_6_1
recode leftright (1/4=0)(5/7=1)

bysort polknow2: reg Q2_5_1 c.SBAid##c.SBAev, beta
bysort polknow2: reg Q2_6_6 c.SBAid##c.SBAev, beta
bysort polknow2: reg Q3_5_1 c.USDAid##c.USDAev, beta
bysort polknow2: reg Q3_6_1 c.USDAid##c.USDAev, beta

bysort leftright: reg Q2_5_1 c.SBAid##c.SBAev, beta
bysort leftright: reg Q2_6_6 c.SBAid##c.SBAev, beta
bysort leftright: reg Q3_5_1 c.USDAid##c.USDAev, beta
bysort leftright: reg Q3_6_1 c.USDAid##c.USDAev, beta

bysort partyID: reg Q2_5_1 c.SBAid##c.SBAev, beta
bysort partyID: reg Q2_6_6 c.SBAid##c.SBAev, beta
bysort partyID: reg Q3_5_1 c.USDAid##c.USDAev, beta
bysort partyID: reg Q3_6_1 c.USDAid##c.USDAev, beta

